/* ============================================================================
   Dreamfire Studios – Projects Index Page
   Ensures only the projects area scrolls while the p5.js background stays fixed.
   ============================================================================ */

:root {
    --header-h: 0px;                 /* set by JS */
    --accent: #F07900;               /* fallback if not defined elsewhere */
}

/* Prevent document/page scrolling */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    overflow: hidden;
}

/* Full page wrapper */
#index-page {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;               /* we scroll the inner section only */
    z-index: 2;                     /* above the canvas */
}

/* Header (height is measured in JS -> --header-h) */
#index-header {
    flex: 0 0 auto;
    padding-top: 2rem;
    text-align: center;
}

/* Title */
#index-main-header {
    color: var(--accent);
    font-size: clamp(2.2rem, 4vw, 3.8rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    text-shadow: 0 4px 16px rgba(0, 0, 0, 0.45);
    margin-bottom: 1rem;
}

/* Create button */
#index-create-button {
    font-size: 22px;
    width: 90%;
    background-color: #151515;
    color: #F8A145;
    margin-bottom: 1rem;
}
#index-create-button:hover {
    transform: scale(1.05);
    background-color: #232323;
    color: #F8A145;
}

/* -------- Scrollable region --------
   Height = viewport minus header (computed dynamically)
------------------------------------*/
#index-container {
    position: relative;
    width: 100%;
    height: calc(100vh - var(--header-h));
    overflow: hidden;               /* clip the inner content */
    touch-action: none;             /* allow custom touch-drag */
    overscroll-behavior: contain;   /* no browser bounce */
}

/* The element we translate() for scrolling */
#index-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: transform 0.15s ease-out;
    will-change: transform;
}

/* Give a little bottom padding so the last row doesn't hit the edge */
#index-content .row {
    padding-bottom: 10vh;
}

/* -------- Cards -------- */
.index-project-item {
    position: relative;
    overflow: hidden;
    display: inline-block;
    border-radius: 40px;
    background-color: rgba(21, 21, 21, 0.85);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.index-project-item:hover {
    transform: scale(1.05);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
}

.index-project-item-image {
    height: 200px;
    width: 100%;
    object-fit: cover;
    border-radius: 40px;
    opacity: 0.65;
    transition: opacity 0.3s ease;
}
.index-project-item:hover .index-project-item-image { opacity: 1; }

.index-project-item-header-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.index-project-item-text {
    font-weight: 800;
    color: #ffffff;
    font-size: clamp(1.5rem, 3vw, 3rem);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-shadow:
            0 2px 4px rgba(0, 0, 0, 0.6),
            0 6px 18px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease, color 0.3s ease;
}

.index-project-item:hover .index-project-item-text {
    color: var(--accent);
    transform: scale(1.05);
}

/* -------- Responsive tweaks -------- */
@media (max-width: 992px) {
    .index-project-item-image { height: 180px; }
}
@media (max-width: 768px) {
    .index-project-item-image { height: 160px; }
    .index-project-item { border-radius: 30px; }
}
@media (max-width: 576px) {
    .index-project-item-image { height: 140px; }
    .index-project-item { border-radius: 24px; }
}